Hi,
You have misplaced some of the code in your sketch, check the following code. Have not tested if it runs properly but I least it compiles ![]()
#include "WiFly.h"
#include "Credentials.h"
Server server(80);
void setup() {
 // start the WiFly connection:
 WiFly.begin();
Â
 if (!WiFly.join(ssid, passphrase)) {
  while (1) {
   // Hang on failure.
  }
 }
 Serial.begin(9600);
 Serial.print("IP: ");
 Serial.println(WiFly.ip());
Â
 server.begin();
 // give the WiFly shield a second to initialize:
 delay(1000);
 Serial.println("connecting...");
Â
 //------rest shall be implemented inside loop()
Â
 // if you get a connection, report back via serial:
 //if (client.connect(server, 1234)) {
 //Â
 // Serial.println("connected");
 //}
 //else {
 // // if you didn't get a connection to the server:
 // Serial.println("connection failed");
 //}
}
void loop() {
 Client client = server.available();
Â
 //If client has been instantiated
 if (client) {
  //check for client connection
  while (client.connected()) {
   //if client has connected
   if (client.available()) {
    //The following code will simply send characters for Terminal input to the server - use it as a test
    while (Serial.available() > 0) {
     char inChar = Serial.read();
      if (client.connected()) {
       client.print(inChar);
      }
    }
   }
  }
 }
 // if the server's disconnected, stop the client:
 if (!client.connected()) {
  Serial.println();
  Serial.println("disconnecting.");
  client.stop();
  // do nothing:
  while(true);
 }
}